package cn.itcast.collection

import scala.collection.mutable.ListBuffer

/**
  * @Package cn.itcast.collection
  * @author KTL
  * @date 2021/5/15 0015 15:23
  * @version V1.0
  * @Copyright © 2015-04-29  One for each, and two for each
  *           Desc 演示scala中List中基本使用-
  */
object Demo03_Seq_set {
  def main(args: Array[String]): Unit = {
    //不可变 注意set无序，且元素不可重复
    val set1: Set[Int] =Set(1,2,3,4,4,5,6,7,8,9)
    println(set1)

    //可变
    //格式相同，导包不同
    import scala.collection.mutable._
    var set2=Set[Int]()
    var set3=Set[Int](1,2,3,4,5)
    set3+=6
    println(set3)

  }
}
